home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tsrhelp.zip / CLRSCR.INC < prev    next >
Text File  |  1992-05-29  |  2KB  |  73 lines

  1. ;---------------------------------------------------------------------------
  2. ; Program:  ClrScr.Inc
  3. ;
  4. ; Author:   Steve Poulsen
  5. ;
  6. ; This procedure will Clr the screen at a window entered in CX and DX with 
  7. ; CL = X1, CH = Y1, DL = X2, DH = Y2. SI should point to the attribute to use.
  8. ;
  9. ; Before:
  10. ;       CX = Upper Left
  11. ;       DX = Lower Right
  12. ;       SI = Pointer to attribute
  13. ; After:
  14. ;       Nothing
  15. ; Changes:
  16. ;       Nothing
  17. ;
  18. ;---------------------------------------------------------------------------
  19. ClrScr  Proc    Near
  20.         Assume CS:Code,DS:Nothing,ES:Nothing
  21.         Push AX
  22.         Push DI
  23.         Push ES
  24.         Push BX
  25.         Push CX
  26.         
  27.         Mov AX,0B800h                   ; Screen memory segment for color
  28.         Mov ES,AX
  29.         
  30.         
  31.         Mov AH,0Fh                      ; Check video mode
  32.         Int 10h
  33.         Cmp AL,07h                      ; Monochrome?
  34.         JNE Clra
  35.         Mov AX,0B000h                   ; Screen memory segment for mono
  36.         Mov ES,AX
  37. Clra:        
  38.         Mov BL,CL                       ; Clear a line at CH
  39.         Mov BH,0
  40.         
  41.         Mov AL,160                      ; Convert to linear
  42.         Mul CH
  43.         Mov DI,AX                       
  44.         Add DI,BX
  45.         Add DI,BX                       ; Put location in DI
  46. Ca:        
  47.         Push DX
  48.         Mov DH,CS:[SI]                  ; Mov Color into DH
  49.         Mov DL,20h                      ; Mov space into DL
  50.         Mov ES:[DI],DX                  ; Put at current location
  51.         Pop DX
  52.         Cmp BL,DL                       ; Compute current location with X2
  53.         JE Na                           ; Jump if done with line
  54.         Inc DI                          ; Move to next X location
  55.         Inc DI
  56.         Inc BL
  57.         Jmp Ca                          ; Repeat for this location
  58. Na:                                      
  59.         Inc DI                          ; Mov to next position
  60.         Inc DI
  61.         Inc CH                          ; Increment Y position
  62.         Cmp CH,DH                       ; Compare Y with Y2
  63.         JLE Clra                        ; Jmp to clear another line
  64.         
  65.         Pop CX
  66.         Pop BX
  67.         Pop ES
  68.         Pop DI
  69.         Pop AX
  70.         Ret
  71. ClrScr EndP
  72.  
  73.